import axios from 'axios'

// 创建一个axios对象
const instance = axios.create({
  baseURL: 'http://localhost:3007',
  timeout: 500
})

instance.interceptors.request.use(
  config => {
    const token = localStorage.getItem('Authorization')
    if(token && token !== '') {
      config.headers['Authorization'] = token
    }
    return config
  },
  error => {
    console.log(err)
    return Promise.reject(error)
  }
)
export default instance

